﻿CREATE TABLE [dbo].[SQLAgentJobDetails](
	[JobId] [int] IDENTITY(1,1) NOT NULL,
	[ServiceID] [int] NOT NULL,
	[JobName] [varchar](100) NOT NULL,
	[Enabled] [varchar](50) NULL,
	[LastRunStatus] [varchar](20) NULL,
	[Category] [varchar](50) NULL,
	[LastRunDateTime] [varchar](100) NULL,
	[Duration] [int] NULL,
 CONSTRAINT [PK_JobDetails] PRIMARY KEY CLUSTERED 
(
	[JobId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO



ALTER TABLE [dbo].[SQLAgentJobDetails]  WITH CHECK ADD  CONSTRAINT [FK_JobDetails_JobDetails] FOREIGN KEY([ServiceId])
REFERENCES [dbo].[Service] ([ServiceID])
GO

ALTER TABLE [dbo].[SQLAgentJobDetails] CHECK CONSTRAINT [FK_JobDetails_JobDetails]
GO
